#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <set>
using namespace std;
class CQueue
{
public:
    stack<int> stk1, stk2;
    CQueue(){};

    void appendTail(int value)
    {
        stk1.push(value);
    }

    int deleteHead()
    {
        while (stk1.empty() == false)
        {
            stk2.push(stk1.top());
            stk1.pop();
        }
        if (stk2.empty() == true)
            return -1;
        int ret = stk2.top();
        stk2.pop();
        while (stk2.empty() == false)
        {
            stk1.push(stk2.top());
            stk2.pop();
        }
        return ret;
    }
};